
$(document).ready(rdy);
function rdy() {


    $("#user").autocomplete({
        source: function(query, add){
            $.getJSON("modules/administration/userService.php", query, function(data) {
                var suggestions = [];
                $.each(data, function(i,val) {
                    suggestions.push(val);
                });
                add(suggestions);
            });
        } ,
        minLength: 3,
        
        select:
        function(e, ui) {
            $("#uid").val(ui.item.uid);
            $("#details").val(ui.item.value);
        }
    });
}